#!/sbin/sh # # Create an HTML index from the installed Freeware products based # on the release notes. # # usage: $0 [-installed|-web] # -installed create index.html and index for installed products. # -web create web pages (i.e. leave out installed.html) # -web is designed for internal SGI use only; generate pages for silicon surf. # # -installed is the default # # input: $COMMON/index.template, $COMMON/*.data # output: $RELDIR/index.html, $RELDIR/installed.html, $RELDIR/*.html # # Generic template sections. TITLE="TITLE" HIGHLIGHTS="HIGHLIGHTS" SIDENAV="SIDENAV" CONTENTS="CONTENTS" # Freeware-specific sections. INST_ED="INSTALLED INDEX" INST_ABLE="INSTALLABLE INDEX" HTTP_LINK="HTTPLINKS" FILE_LINK="FILELINKS" ####################### ## begin subroutines ## ####################### # rmsection $input_file $section rmsection() { sed -e "//,//d" <$1 >$TMP mv -f $TMP $1 } # applyfilters $input_file applyfilters() { [ true = $RMINSTED ] && rmsection $1 "$INST_ED" if [ ! -f $RELDIR/index-by-alpha.html ]; then ## fw_latest is not available [ true = $RMINSTABLE ] && rmsection $1 "$INST_ABLE" fi [ true = $RMHTTPLINK ] && rmsection $1 "$HTTP_LINK" [ true = $RMFILELINK ] && rmsection $1 "$FILE_LINK" } # mergetemplate $template $data $result mergetemplate() { template=$1 data=$2 result=$3 rm -f $result $TMP # Splice the title and contents sections into the template. sed -n -e "1,//p" $template > $TMP sed -n -e "//,//p" $data >> $TMP sed -n -e "//,//p" $template >> $TMP sed -n -e "//,//p" $data >> $TMP sed -n -e "//,\$p" $template >> $TMP mv -f $TMP $result # Remove any unwanted generic template sections if grep -q -e "" $data; then rmsection $result "$SIDENAV" fi if grep -q -e "" $data; then rmsection $result "$HIGHLIGHTS" fi # Let data files override normal template sections. if grep -q -e "" $data; then rmsection $result "$INST_ED" fi if grep -q -e "" $data; then rmsection $result "$INST_ABLE" fi if grep -q -e "" $data; then rmsection $result "$HTTP_LINK" fi if grep -q -e "" $data; then rmsection $result "$FILE_LINK" fi } # makeinstalled $input_file $output_file makeinstalled() { rm -f $TMP.data cat >> $TMP.data < Installed Freeware

Installed Freeware